<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/

use App\Entity\Member;

//Route::get('/', function () {
//    return view('welcome');
//});




//查看member表中的json格式的数据
Route::get('/', function () {
    return Member::all();
});

//登录的路由
//Route::get('/login', function () {
//    return view('login');
//});
Route::get('/login', 'View\MemberController@toLogin');

//测试登录成功的跳转页面
Route::get('/category',function (){
    return view('/category') ;
});
//注册的路由
//Route::get('/register', function () {
//    return view('register');
//});
Route::get('/register','View\MemberController@toRegister');
//通过get方式显示书籍类别的路由
Route::get('/category','View\BookController@toCategory');




//使用路由分组（对接口进行分组）
//一旦请求是post请求，在进行ajax提交请求的时候一定要加上token值
Route::group(['prefix'=>'service'],function (){
    Route::post('/register', 'Service\MemberController@register');
    Route::post('/login', 'Service\MemberController@login');
    Route::post('/validate_phone/send', 'Service\ValidateCodeController@sendSMS');   //手机短信验证码的路由
    Route::get('/validate_code/create', 'Service\ValidateCodeController@create');  //图形验证码的路由
    //Route::any('/validate_email', 'Service\ValidateCodeController@validateEmail');   //发送验证邮件的路由
});




//Route::post('/service/register', 'Service\MemberController@register');
//Route::post('/service/login', 'Service\MemberController@login');
//
////图形验证码的路由
//Route::any('/service/validate_code/create', 'Service\ValidateCodeController@create');
//
////手机短信验证码的路由
//Route::any('/service/validate_phone/send', 'Service\ValidateCodeController@sendSMS');







